package cn.pegasus.teamwork.pegasus.controller;

import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import cn.iyizhan.teamwork.base.util.PageObject;
import cn.pegasus.teamwork.manager.controller.BaseManagerController;
import cn.pegasus.teamwork.pegasus.entity.BussWasherSgin;
import cn.pegasus.teamwork.pegasus.mapper.BussWasherSginMapper;
import cn.pegasus.teamwork.pegasus.service.BussWasherSginService;

@Controller
@RequestMapping("/washerSgin")
public class WasherSginController extends BaseManagerController<BussWasherSgin,BussWasherSginMapper>{

	private static final Logger logger = LoggerFactory.getLogger(WasherInfoController.class);
	
	@Autowired
	private BussWasherSginService washerSginService;
	
	/**
	 * 分页查询洗车工签到列表
	 */
	@RequestMapping(value="/list")
	public ModelAndView list(@RequestParam Map<String, Object> map){
		ModelAndView view = new ModelAndView("user/sgin-list");
		if(map.isEmpty()){
			map.put("pageData", 10);
			map.put("curPage", 1);
		}
		try{
			PageObject<BussWasherSgin> dicList = washerSginService.PageList(map);
			view.addObject("list", dicList);
			view.addObject("map", map);
		}catch(Exception e){
			logger.error("查询区域列表信息异常",e.getMessage());
		}
		return view;
	}
}
